import java.util.Scanner;

public class Main1724 {
    public static void main(String[] args) {
        Scanner sc =new Scanner(System.in);
        int n= sc.nextInt();
        int[] arr=new int[n];
        for (int i=0;i<n;i++){
            arr[i]=sc.nextInt();
        }
        int max=0;
        int min=arr[0];
        for (int i=0;i< arr.length;i++){
            if (max<arr[i]){
                max=arr[i];
            }if (min>arr[i]){
                min=arr[i];
            }
        }
        int s=0;
        for (int i=0;i<n;i++){
            s=s+arr[i];
        }
        int max1=0;
        int a=0;
        int min1=0;
        int b=0;
        for (int i=0;i<n;i++){
            if(arr[i]==max){
                max1=max1+max;
                a++;
            }if (arr[i]==min){
                min1=min1+min;
                b++;
            }
        }
        int n1=n-a-b;
        int w=s-max1-min1;
        System.out.println(w);
        double c=(double) w/n1;

        System.out.println(String.format("%.1f",c));

    }
}
